package com.yx.shop.entitly.pojo;

import java.io.Serializable;

/**
 * @Classname ResponseResult
 * @Description TODO:
 * @Date 2021/05/10 15:51
 * @Created by yx
 */
public class ResponseResult<T> implements Serializable {
    private int code;
    private String comment;
    private T data;

    public ResponseResult createSuccess(int code,String comment,T data){
        return new ResponseResult(code,comment,data);
    }
    public ResponseResult createFail(int code,String comment,T data){
        return new ResponseResult(code,comment,data);
    }

    @Override
    public String toString() {
        return "ResponseResult{" +
                "code=" + code +
                ", comment='" + comment + '\'' +
                ", data=" + data +
                '}';
    }

    public ResponseResult(int code) {
        this.code = code;
    }

    public ResponseResult(String comment, T data) {
        this.comment = comment;
        this.data = data;
    }

    public ResponseResult(int code, String comment, T data) {
        this.code = code;
        this.comment = comment;
        this.data = data;
    }

    public ResponseResult() {
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
